<?php
/*
 * childtheme_override_commentmeta
 */
function childtheme_override_commentmeta(){
	?>
		<span class="cm-date"><?php comment_date();?></span>	
		<span class="cm-time"><?php comment_time();?></span>
		<a class="cm-permalink" href="#comment-<?php comment_ID()?>" title="Permalink to this comment">Permalink</a>
<?php 	if ( get_edit_comment_link() ) {?>
			<a class="cm-edit-link" href="<?php echo get_edit_comment_link(); ?>" title="<?php _e( 'Edit comment' )?>">
<?php 			_e( 'Edit', 'thematic' )?>
			</a>
<?php 	}?>
<?php 
}

/*
 * override thematic comment template
 */
function child_thematic_comments($comment, $args, $depth) {
	$GLOBALS['comment'] = $comment;
	$GLOBALS['comment_depth'] = $depth;
    ?>
    	<li id="comment-<?php comment_ID() ?>" class="<?php thematic_comment_class() ?>">
    		<?php thematic_abovecomment() ?>
    		<div class="comment-meta vcard">
    		<?php 
	    		//thematic_commenter_link()
	    		$cm_author_email = get_comment_author_email();
	    		$default_avartar = '';
	    		echo get_avatar($cm_author_email, '80', THEME_URI . 'images/default_avatar.png');    		 
    		?>
    		<?php thematic_commentmeta(); ?>
    		</div><!-- .comment-meta -->
    		<div class="comment-content-wapper">
	    		<div class="comment-author">
	    		<?php echo get_comment_author_link();?>
	    		</div>
	    		<?php if ($comment->comment_approved == '0') _e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'thematic') ?>
	            <div class="comment-content">
	        		<?php comment_text() ?>
	    		</div>
				<?php // echo the comment reply link with help from Justin Tadlock http://justintadlock.com/ and Will Norris http://willnorris.com/
					if($args['type'] == 'all' || get_comment_type() == 'comment') :
						comment_reply_link(array_merge($args, array(
							'reply_text' => __('Reply','thematic'), 
							'login_text' => __('Log in to reply.','thematic'),
							'depth' => $depth,
							'before' => '<div class="comment-reply-link-wrapper">', 
							'after' => '</div>'
						)));
					endif;
			thematic_belowcomment();
			?>
			</div><!-- .comment-content-wapper -->
			<?php 
}

/*
 * filter list_comments_arg to callback child_thematic_comments() 
 */
function filter_list_comments_arg($args) {
	return preg_replace('/thematic_comments/', 'child_thematic_comments', $args);
}
add_filter('list_comments_arg', 'filter_list_comments_arg');
